package com.itboye.lottery.presenter;

import com.itboye.lottery.bean.AddressBean;
import com.itboye.lottery.bean.AppConfigBean;
import com.itboye.lottery.bean.BalanceBean;
import com.itboye.lottery.bean.BetBean;
import com.itboye.lottery.bean.BetDetailBean;
import com.itboye.lottery.bean.BetZqDetailBean;
import com.itboye.lottery.bean.ColorBallPrizeHisBean;
import com.itboye.lottery.bean.FindBean;
import com.itboye.lottery.bean.FollowIndexBean;
import com.itboye.lottery.bean.FollowOrderDetailBean;
import com.itboye.lottery.bean.HistoryPrizeBean;
import com.itboye.lottery.bean.HotPeoleDetail;
import com.itboye.lottery.bean.IndexDataBean;
import com.itboye.lottery.bean.JinEDetail;
import com.itboye.lottery.bean.MessageBean;
import com.itboye.lottery.bean.MyFollowDetailBean;
import com.itboye.lottery.bean.NoticeBean;
import com.itboye.lottery.bean.OrderBean;
import com.itboye.lottery.bean.OutWrapBean;
import com.itboye.lottery.bean.PaySupportBean;
import com.itboye.lottery.bean.PeopleBean;
import com.itboye.lottery.bean.UserDataBean;
import com.itboye.lottery.bean.ZhuiHaoDetailBean;
import com.itboye.lottery.bean.ZqMatchDataCheck;
import com.itboye.lottery.retrofit.HttpResponse;
import com.itboye.lottery.retrofit.ResponseCallback;
import com.itboye.lottery.retrofit.RetrofitMethod;
import com.itboye.lottery.retrofit.subscriber.CommonSubscriber;
import com.itboye.lottery.retrofit.subscriber.SubscriberListener;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by bigHead on 2018/1/4.
 */

public class UserPresenter {

    public String WX_LOGIN_SUCCESS = "wx_login_success";
    public String WX_LOGIN_FAIL = "wx_login_fail";

    public static String updateUserInfo_SUCCESS = "WX_LOGIN_SUCCESS";
    public static String updateUserInfo_FAIL = "WX_LOGIN_FAIL";
    public String updateAddress_SUCCESS = "updateAddress_SUCCESS";
    public String addAddress_SUCCESS = "addAddress_SUCCESS";
    public String updateAddress_FAIL = "updateAddress_FAIL";
    public String addAddress_FAIL = "addAddress_FAIL";

    ResponseCallback responseCallback;
    public String sendCode_FAIL = "sendCode_FAIL";
    public String sendCode_SUCCESS = "sendCode_SUCCESS";
    public String bindPhone_FAIL = "bindPhone_FAIL";
    public String bindPhone_SUCCESS = "bindPhone_SUCCESS";


    public String updatePhone_FAIL = "updatePhone_FAIL";
    public String updatePhone_SUCCESS = "updatePhone_SUCCESS";

    public String uploadAvatar_FAIL = "uploadAvatar_FAIL";
    public String uploadAvatar_SUCCESS = "uploadAvatar_SUCCESS";
    public String homeIndex_FAIL = "homeIndex_FAIL";
    public String homeIndex_SUCCESS = "homeIndex_SUCCESS";
    public String getBetList_SUCCESS = "homeIndex_SUCCESS";
    public String getBetList_FAIL = "getBetList_FAIL";
    public String feedback_FAIL = "feedback_FAIL";
    public String feedback_SUCCESS = "feedback_SUCCESS";
    public String messageQuery_FAIL = "messageQuery_FAIL";
    public String messageQuery_SUCCESS = "messageQuery_SUCCESS";
    public String getAddressList_FAIL = "getAddressList_FAIL";
    public String getAddressList_SUCCESS = "getAddressList_SUCCESS";
    public String deleteAddress_FAIL = "deleteAddress_FAIL";
    public String deleteAddress_SUCCESS = "deleteAddress_SUCCESS";
    public String chooseAddress_FAIL = "chooseAddress_FAIL";
    public String chooseAddress_SUCCESS = "chooseAddress_SUCCESS";
    public String betShuZiCaiDetail_SUCCESS = "betShuZiCaiDetail_SUCCESS";
    public String betShuZiCaiDetail_FAIL = "betShuZiCaiDetail_FAIL";
    public String getWithdrawalBalance_FAIL = "getWithdrawalBalance_FAIL";
    public String getWithdrawalBalance_SUCCESS = "getWithdrawalBalance_SUCCESS";
    public String colorBallPrizeHistory_SUCCESS = "_colorBallPrizeHistory_SUCCESS";
    public String colorBallPrizeHistory_FAIL = "_colorBallPrizeHistory_FAIL";
    public String daLeTouPrizeHistory_SUCCESS = "_daLeTouPrizeHistory_SUCCESS";
    public String daLeTouPrizeHistory_FAIL = "_daLeTouPrizeHistory_FAIL";
    public String createOrderForColorBall_FAIL = "createOrder_FAIL";
    public String createOrderForColorBall_SUCCESS = "createOrder_SUCCESS";
    public String paySupport_FAIL = "paySupport_FAIL";
    public String paySupport_SUCCESS = "paySupport_SUCCESS";

    public String createOrderForDaLeTou_SUCCESS = "createOrderForDaLeTou_SUCCESS";
    public String createOrderForDaLeTou_FAIL = "createOrderForDaLeTou_FAIL";
    public String geFootBallMatch_FAIL = "geFootBallMatch_FAIL";
    public String geFootBallMatch_SUCCESS = "geFootBallMatch_SUCCESS";
    public String zqCreateOrder_FAIL = "zqCreateOrder_FAIL";
    public String zqCreateOrder_SUCCESS = "zqCreateOrder_SUCCESS";
    public String pay_FAIL = "pay_FAIL";
    public String pay_SUCCESS = "pay_SUCCESS";
    public String chongzhi_FAIL = "chongzhi_FAIL";
    public String chongzhi_SUCCESS = "chongzhi_SUCCESS";
    public String betZqCaiDetail_SUCCESS = "_betZqCaiDetail_SUCCESS";
    public String betZqCaiDetail_FAIL = "_betZqCaiDetail_FAIL";
    public String tixianShenQing_FAIL = "tixianShenQing_FAIL";
    public String tixianShenQing_SUCCESS = "tixianShenQing_SUCCES";
    public String mingxi_SUCCESS = "mingxi_SUCCESS";
    public String mingxi_FAIL = "mingxi_FAIL";
    public String getNotice_SUCCESS = "getNotice_SUCCESS";
    public String getNotice_FAIL = "getNotice_FAIL";
    public String getNoticeDetail_FAIL = "getNoticeDetail_FAIL";
    public String getNoticeDetail_SUCCESS = "getNoticeDetail_SUCCESS";
    public String getNoticeZqDetail_SUCCESS = "getNoticeZqDetail_SUCCESS";
    public String getNoticeZqDetail_FAIL = "getNoticeZqDetail_FAIL";
    public String getHistoryPrize_FAIL = "getHistoryPrize_FAIL";
    public String getHistoryPrize_SUCCESS = "getHistoryPrize_SUCCESS";
    public String getAvailableBalance_FAIL = "getAvailableBalance_FAIL";
    public String getAvailableBalance_SUCCESS = "getAvailableBalance_SUCCESS";
    public String getFind_SUCCESS = "getFind_SUCCESS";
    public String getFind_FAIL = "getFind_FAIL";
    public String faqigendan_SUCCESS = "_faqigendan_SUCCESS";
    public String faqigendan_FAIL = "_faqigendan_FAIL";
    public String getFollowIndex_SUCCESS = "getFollowIndex_SUCCESS";
    public String getFollowIndex_FAIL = "getFollowIndex_FAIL";
    public String getHotPeopleList_FAIL = "getHotPeopleList_FAIL";
    public String getHotPeopleList_SUCCESS = "getHotPeopleList_SUCCESS";
    public String followCase_FAIL = "followCase_FAIL";
    public String followCase_SUCCESS = "followCase_SUCCESS";
    public String getHotPeopleDetail_SUCCESS = "getHotPeopleDetail_SUCCESS";
    public String getHotPeopleDetail_FAIL = "getHotPeopleDetail_FAIL";
    public String myGenDan_SUCCESS = "myGenDan_SUCCESS";
    public String myGenDan_FAIL = "myGenDan_FAIL";
    public String myTuiJian_SUCCESS = "myTuiJian_SUCCESS";
    public String myTuiJian_FAIL = "myTuiJian_FAIL";
    public String getDaShenFollowDetail_SUCCESS = "getDaShenFollowDetail_SUCCESS";
    public String getDaShenFollowDetail_FAIL = "getDaShenFollowDetail_FAIL";
    public String getFollowDetail_SUCCESS = "getFollowDetail_SUCCESS";
    public String getFollowDetail_FAIL = "getFollowDetail_FAIL";
    public String getFaDanDetail_FAIL = "getFaDanDetail_FAIL";
    public String getFaDanDetail_SUCCESS = "getFaDanDetail_SUCCESS";
    public String findDetail_FAIL = "findDetail_FAIL";
    public String findDetail_SUCCESS = "findDetail_FAIL";
    public String getZhuiHaoDetail_SUCCESS = "getZhuiHaoDetail_SUCCESS";
    public String getZhuiHaoDetail_FAIL = "getZhuiHaoDetail_FAIL";
    public String getZhuiHaoList_SUCCESS = "getZhuiHaoList_SUCCESS";
    public String getZhuiHaoList_FAIL = "getZhuiHaoList_FAIL";
    public String getMyAttentionList_SUCCESS = "getMyAttentionList_SUCCESS";
    public String getMyAttentionList_FAIL = "getMyAttentionList_FAIL";
    public String follow_SUCCESS = "follow_SUCCESS";
    public String follow_FAIL = "follow_FAIL";
    public String getMyLotteryFragmentData_FAIL = "getMyLotteryFragmentData_FAIL";
    public String getMyLotteryFragmentData_SUCCESS = "getMyLotteryFragmentData_SUCCESS";
    public String getFootBallMathDataCheck_SUCCESS = "getFootBallMathDataCheck_SUCCESS";
    public String getFootBallMathDataCheck_FAIL = "getFootBallMathDataCheck_FAIL";
    public String getBasketballMatch_SUCCESS = "getBasketballMatch_SUCCESS";
    public String getBasketballMatch_FAIL = "getBasketballMatch_FAIL";
    public String lqCreateOrder_SUCCESS = "lqCreateOrder_SUCCESS";
    public String lqCreateOrder_FAIL = "lqCreateOrder_FAIL";
    public String zfbH5Pay_FAIL = "_zfbH5Pay_FAIL";
    public String zfbH5Pay_SUCCESS = "_zfbH5Pay_SUCCESS";
    public String chongzhiByFs_SUCCESS = "chongzhiByFs_SUCCESS";
    public String chongzhiByFs_FAIL = "chongzhiByFs_FAIl";
    public String optimize_SUCCESS = "optimize_SUCCESS";
    public String optimize_FAIL = "optimize_FAIL";
    public String isRegister_SUCCESS = "isRegister_SUCCESS";
    public String isRegister_FAIL = "isRegister_FAIL";
    public String getBasketballMathDataCheck_FAIL = "getBasketballMathDataCheck_FAIL";
    public String getBasketballMathDataCheck_SUCCESS = "getBasketballMathDataCheck_SUCCESS";
    public String loginByPhone_SUCCESS = "_loginByPhone_SUCCESS";
    public String loginByPhone_FAIL = "_loginByPhone_FAIL";
    public String registerByPhone_FAIL="registerByPhone_FAIL";
    public String registerByPhone_SUCCESS="registerByPhone_SUCCESS";


    public UserPresenter(ResponseCallback responseCallback) {
        this.responseCallback = responseCallback;
    }

    public void wxLogin(String wxCode, String phone, String invite_code, String mobileCode) {
        CommonSubscriber<HttpResponse<UserDataBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<UserDataBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, WX_LOGIN_FAIL);
            }

            @Override
            public void onNext(HttpResponse<UserDataBean> o) {
                responseCallback.success(o.getData(), WX_LOGIN_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().wxLogin(subscriber, wxCode, phone, invite_code, mobileCode);
    }

    //修改用户信息
    public void updateUserInfo(String nickname) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, updateUserInfo_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), updateUserInfo_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().updateUserInfo(subscriber, nickname);
    }

    public void sendCode(int type, @NotNull String phone) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, sendCode_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), sendCode_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().sendCode(subscriber, type, phone);
    }

    public void bindPhone(@NotNull String phone, @NotNull String code) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, bindPhone_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), bindPhone_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().bindPhone(subscriber, phone, code);
    }

    public void updatePhone(@NotNull String phone, @NotNull String code) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, updatePhone_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getMsg(), updatePhone_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().updatePhone(subscriber, phone, code);
    }

    public void uploadAvatar(File file) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, uploadAvatar_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), uploadAvatar_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().uploadAvatar(subscriber, file);
    }

    public void homeIndex() {
        CommonSubscriber<HttpResponse<IndexDataBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<IndexDataBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, homeIndex_FAIL);
            }

            @Override
            public void onNext(HttpResponse<IndexDataBean> o) {
                responseCallback.success(o.getData(), homeIndex_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().homeIndex(subscriber);
    }

    public void getBetList(int type, int page) {
        CommonSubscriber<HttpResponse<List<BetBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<List<BetBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getBetList_FAIL);
            }

            @Override
            public void onNext(HttpResponse<List<BetBean>> o) {
                responseCallback.success(o.getData(), getBetList_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getBetList(subscriber, type, page);
    }

    public void feedback(String content) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, feedback_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), feedback_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().feedback(subscriber, content);
    }

    public void messageQuery(int mParam1, int page) {

        CommonSubscriber<HttpResponse<List<MessageBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<List<MessageBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, messageQuery_FAIL);
            }

            @Override
            public void onNext(HttpResponse<List<MessageBean>> o) {
                responseCallback.success(o.getData(), messageQuery_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().messageQuery(subscriber, mParam1, page);
    }

    public void getAddressList(String addressId) {
        CommonSubscriber<HttpResponse<AddressBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<AddressBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getAddressList_FAIL);
            }

            @Override
            public void onNext(HttpResponse<AddressBean> o) {
                responseCallback.success(o.getData(), getAddressList_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getAddressList(subscriber, addressId);
    }

    public void updateAddress(String address_id, String consigneeName, String consigneeMobile, String province, String city, String district, String pcd, String isDefault) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, updateAddress_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), updateAddress_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().updateAddress(subscriber, address_id, consigneeName, consigneeMobile, province, city, district, pcd, isDefault);
    }

    public void addAddress(String consigneeName, String consigneeMobile, String province, String city, String district, String pcd, String isDefault) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, addAddress_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), addAddress_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().addAddress(subscriber, consigneeName, consigneeMobile, province, city, district, pcd, isDefault);
    }

    public void deleteAddress(String address_id) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, deleteAddress_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), deleteAddress_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().deleteAddress(subscriber, address_id);
    }

    public void chooseAddress(String addressId) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, chooseAddress_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), chooseAddress_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().chooseAddress(subscriber, addressId);
    }

    public void getWithdrawalBalance() {
        CommonSubscriber<HttpResponse<BalanceBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<BalanceBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getWithdrawalBalance_FAIL);
            }

            @Override
            public void onNext(HttpResponse<BalanceBean> o) {
                responseCallback.success(o.getData(), getWithdrawalBalance_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getWithdrawalBalance(subscriber);
    }

    public void colorBallPrizeHistory() {
        CommonSubscriber<HttpResponse<ColorBallPrizeHisBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ColorBallPrizeHisBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, colorBallPrizeHistory_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ColorBallPrizeHisBean> o) {
                responseCallback.success(o.getData(), colorBallPrizeHistory_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().colorBallPrizeHistory(subscriber);
    }

    public void daLeTouPrizeHistory() {
        CommonSubscriber<HttpResponse<ColorBallPrizeHisBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ColorBallPrizeHisBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, daLeTouPrizeHistory_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ColorBallPrizeHisBean> o) {
                responseCallback.success(o.getData(), daLeTouPrizeHistory_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().daLeTouPrizeHistory(subscriber);
    }

    public void createOrderForColorBall(String num, int multiple, String push_number, int is_rand, int is_stop, int stop_money) {
        CommonSubscriber<HttpResponse<OrderBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<OrderBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, createOrderForColorBall_FAIL);
            }

            @Override
            public void onNext(HttpResponse<OrderBean> o) {
                responseCallback.success(o.getData(), createOrderForColorBall_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().createOrderForColorBall(subscriber, num, multiple, push_number, is_rand, is_stop, stop_money);
    }

    public void createOrderForDaLeTou(String num, int multiple, String push_number, int is_rand, int is_stop, int stop_money) {
        CommonSubscriber<HttpResponse<OrderBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<OrderBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, createOrderForDaLeTou_FAIL);
            }

            @Override
            public void onNext(HttpResponse<OrderBean> o) {
                responseCallback.success(o.getData(), createOrderForDaLeTou_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().createOrderForDaLeTou(subscriber, num, multiple, push_number, is_rand, is_stop, stop_money);
    }

    public void paySupport() {
        CommonSubscriber<HttpResponse<List<PaySupportBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<List<PaySupportBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, paySupport_FAIL);
            }

            @Override
            public void onNext(HttpResponse<List<PaySupportBean>> o) {
                responseCallback.success(o.getData(), paySupport_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().paySupport(subscriber);
    }

    public void geFootBallMatch() {
        CommonSubscriber<HttpResponse<Object>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<Object>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, geFootBallMatch_FAIL);
            }

            @Override
            public void onNext(HttpResponse<Object> o) {
                responseCallback.success(o.getData(), geFootBallMatch_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().geFootBallMatch(subscriber);
    }

    public void zqCreateOrder(String num, String origin_num, int multiple, String passType) {
        CommonSubscriber<HttpResponse<OrderBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<OrderBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, zqCreateOrder_FAIL);
            }

            @Override
            public void onNext(HttpResponse<OrderBean> o) {
                responseCallback.success(o.getData(), zqCreateOrder_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().zqCreateOrder(subscriber, num, origin_num, multiple, passType);
    }

    public void lqCreateOrder(String num, String origin_num, int multiple, String passType) {
        CommonSubscriber<HttpResponse<OrderBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<OrderBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, lqCreateOrder_FAIL);
            }

            @Override
            public void onNext(HttpResponse<OrderBean> o) {
                responseCallback.success(o.getData(), lqCreateOrder_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().lqCreateOrder(subscriber, num, origin_num, multiple, passType);
    }

    public void pay(String sn, double amount) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, pay_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), pay_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().pay(subscriber, sn, amount);
    }

//    public void chongzhi(double money) {
//        CommonSubscriber<HttpResponse<OrderBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<OrderBean>>() {
//            @Override
//            public void onError(String e, int code) {
//                responseCallback.fail(code, e, chongzhi_FAIL);
//            }
//
//            @Override
//            public void onNext(HttpResponse<OrderBean> o) {
//                responseCallback.success(o, chongzhi_SUCCESS);
//            }
//        });
//        RetrofitMethod.getInstance().chongzhi(subscriber, money);
//    }


    public void betShuZiCaiDetail(String sn) {
        CommonSubscriber<HttpResponse<BetDetailBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<BetDetailBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, betShuZiCaiDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<BetDetailBean> o) {
                responseCallback.success(o.getData(), betShuZiCaiDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().betShuZiCaiDetail(subscriber, sn);
    }


    public void betZqCaiDetail(String id) {
        CommonSubscriber<HttpResponse<BetZqDetailBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<BetZqDetailBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, betZqCaiDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<BetZqDetailBean> o) {
                responseCallback.success(o.getData(), betZqCaiDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().betZqCaiDetail(subscriber, id);
    }

    public void tixianShenQing(@NotNull String money, @Nullable String account, String account_type, String owner_name, String bank_branch_address) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, tixianShenQing_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getMsg(), tixianShenQing_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().tixianShenQing(subscriber, money, account, account_type, owner_name, bank_branch_address);
    }

    public void mingxi(int type, int page) {
        CommonSubscriber<HttpResponse<ArrayList<JinEDetail>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<JinEDetail>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, mingxi_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<JinEDetail>> o) {
                responseCallback.success(o.getData() == null ? new ArrayList<JinEDetail>() : o.getData(), mingxi_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().mingxi(subscriber, type, page);
    }

    public void getNotice() {
        CommonSubscriber<HttpResponse<NoticeBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<NoticeBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getNotice_FAIL);
            }

            @Override
            public void onNext(HttpResponse<NoticeBean> o) {
                responseCallback.success(o.getData(), getNotice_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getNotice(subscriber);
    }

    public void getNoticeDetail(String id) {
        CommonSubscriber<HttpResponse<NoticeBean.NoticeItem>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<NoticeBean.NoticeItem>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getNoticeDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<NoticeBean.NoticeItem> o) {
                responseCallback.success(o.getData(), getNoticeDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getNoticeDetail(subscriber, id);
    }

    public void getNoticeZqDetail(String ball_type, long open_time) {
        CommonSubscriber<HttpResponse<ArrayList<NoticeBean.NoticeItem>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<NoticeBean.NoticeItem>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getNoticeZqDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<NoticeBean.NoticeItem>> o) {
                responseCallback.success(o.getData(), getNoticeZqDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getNoticeZqDetail(subscriber, ball_type, open_time);
    }

    public void getDltHistoryPrize() {
        CommonSubscriber<HttpResponse<HistoryPrizeBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<HistoryPrizeBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getHistoryPrize_FAIL);
            }

            @Override
            public void onNext(HttpResponse<HistoryPrizeBean> o) {
                responseCallback.success(o.getData(), getHistoryPrize_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getHistoryPrize(subscriber);
    }

    public void getSsqHistoryPrize() {
        CommonSubscriber<HttpResponse<HistoryPrizeBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<HistoryPrizeBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getHistoryPrize_FAIL);
            }

            @Override
            public void onNext(HttpResponse<HistoryPrizeBean> o) {
                responseCallback.success(o.getData(), getHistoryPrize_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getSsqHistoryPrize(subscriber);
    }

    public void getAvailableBalance() {
        CommonSubscriber<HttpResponse<Double>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<Double>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getAvailableBalance_FAIL);
            }

            @Override
            public void onNext(HttpResponse<Double> o) {
                responseCallback.success(o.getData(), getAvailableBalance_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getAvailableBalance(subscriber);
    }

    public void getPlayCenter() {
        CommonSubscriber<HttpResponse<ArrayList<FindBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<FindBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getFind_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<FindBean>> o) {
                responseCallback.success(o.getData(), getFind_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getPlayCenter(subscriber);
    }

    public void getNews(int page) {
        CommonSubscriber<HttpResponse<ArrayList<FindBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<FindBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getFind_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<FindBean>> o) {
                responseCallback.success(o.getData(), getFind_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getNews(subscriber, page);
    }

    public void getNewsNotice(int page) {
        CommonSubscriber<HttpResponse<ArrayList<FindBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<FindBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getFind_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<FindBean>> o) {
                responseCallback.success(o.getData(), getFind_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getNewsNotice(subscriber, page);
    }

    public void getAtivities(int page) {
        CommonSubscriber<HttpResponse<ArrayList<FindBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<FindBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getFind_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<FindBean>> o) {
                responseCallback.success(o.getData(), getFind_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getAtivities(subscriber, page);
    }

    public void faqigendan(int lottery_type, String num, String orignNum, int multiple, String pass_type, int type, int public_type, String reason, String low_amount, String ensure_odds) {
        CommonSubscriber<HttpResponse<OrderBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<OrderBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, faqigendan_FAIL);
            }

            @Override
            public void onNext(HttpResponse<OrderBean> o) {
                responseCallback.success(o.getData(), faqigendan_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().faqigendan(subscriber, lottery_type, num, orignNum, multiple, pass_type, type, public_type, reason, low_amount, ensure_odds);
    }

    public void getFollowIndex(int sort, int page, int page_size, int is_follow) {
        CommonSubscriber<HttpResponse<FollowIndexBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<FollowIndexBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getFollowIndex_FAIL);
            }

            @Override
            public void onNext(HttpResponse<FollowIndexBean> o) {
                responseCallback.success(o.getData(), getFollowIndex_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getFollowIndex(subscriber, sort, page, page_size, is_follow);
    }

    public void getHotPeopleList(int page, int pageSize) {
        CommonSubscriber<HttpResponse<ArrayList<PeopleBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<PeopleBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getHotPeopleList_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<PeopleBean>> o) {
                responseCallback.success(o.getData(), getHotPeopleList_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getHotPeopleList(subscriber, page, pageSize);
    }

    public void followCase(int plan_id, int num) {
        CommonSubscriber<HttpResponse<OrderBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<OrderBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, followCase_FAIL);
            }

            @Override
            public void onNext(HttpResponse<OrderBean> o) {
                responseCallback.success(o.getData(), followCase_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().followCase(subscriber, plan_id, num);
    }

    public void getHotPeopleDetail(String hotPeopleId, int type, int page, int size) {
        CommonSubscriber<HttpResponse<HotPeoleDetail>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<HotPeoleDetail>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getHotPeopleDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<HotPeoleDetail> o) {
                responseCallback.success(o.getData(), getHotPeopleDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getHotPeopleDetail(subscriber, hotPeopleId, type, page, size);
    }

    public void myGenDan(int type, int page, int size) {
        CommonSubscriber<HttpResponse<ArrayList<BetBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<BetBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, myGenDan_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<BetBean>> o) {
                responseCallback.success(o.getData(), myGenDan_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().myGenDan(subscriber, type, page, size);
    }

    public void myTuiJian(int type, int page, int size) {
        CommonSubscriber<HttpResponse<ArrayList<BetBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<BetBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, myTuiJian_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<BetBean>> o) {
                responseCallback.success(o.getData(), myTuiJian_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().myTuiJian(subscriber, type, page, size);
    }

    public void getDaShenFollowDetail(String orderId) {
        CommonSubscriber<HttpResponse<FollowOrderDetailBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<FollowOrderDetailBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getDaShenFollowDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<FollowOrderDetailBean> o) {
                responseCallback.success(o.getData(), getDaShenFollowDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getDaShenFollowDetail(subscriber, orderId);
    }

    public void getFollowDetail(String orderId, String lUid) {
        CommonSubscriber<HttpResponse<MyFollowDetailBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<MyFollowDetailBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getFollowDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<MyFollowDetailBean> o) {
                responseCallback.success(o.getData(), getFollowDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getFollowDetail(subscriber, orderId, lUid);
    }

    public void getFaDanDetail(String orderId) {
        CommonSubscriber<HttpResponse<FollowOrderDetailBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<FollowOrderDetailBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getFaDanDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<FollowOrderDetailBean> o) {
                responseCallback.success(o.getData(), getFaDanDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getFaDanDetail(subscriber, orderId);
    }

    public void newsDetail(String articalId) {
        CommonSubscriber<HttpResponse<FindBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<FindBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, findDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<FindBean> o) {
                responseCallback.success(o.getData(), findDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().newsDetail(subscriber, articalId);
    }

    public void huoDongDetail(String articalId) {
        CommonSubscriber<HttpResponse<FindBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<FindBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, findDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<FindBean> o) {
                responseCallback.success(o.getData(), findDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().huoDongDetail(subscriber, articalId);
    }

    public void gongGaoDetail(String articalId) {
        CommonSubscriber<HttpResponse<FindBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<FindBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, findDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<FindBean> o) {
                responseCallback.success(o.getData(), findDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().gongGaoDetail(subscriber, articalId);
    }

    public void getZhuiHaoList(int page) {
        CommonSubscriber<HttpResponse<ArrayList<BetBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<BetBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getZhuiHaoList_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<BetBean>> o) {
                responseCallback.success(o.getData(), getZhuiHaoList_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getZhuiHaoList(subscriber, page);
    }

    public void getZhuiHaoDetail(String id) {
        CommonSubscriber<HttpResponse<ZhuiHaoDetailBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ZhuiHaoDetailBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getZhuiHaoDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ZhuiHaoDetailBean> o) {
                responseCallback.success(o.getData(), getZhuiHaoDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getZhuiHaoDetail(subscriber, id);
    }

    public void getAppConfig() {
        CommonSubscriber<HttpResponse<ArrayList<AppConfigBean>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<AppConfigBean>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getZhuiHaoDetail_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<AppConfigBean>> o) {
                responseCallback.success(o.getData(), getZhuiHaoDetail_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getAppConfig(subscriber);
    }

    public void getMyAttentionList(int page, int pageSize, int follow) {
        CommonSubscriber<HttpResponse<OutWrapBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<OutWrapBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getMyAttentionList_FAIL);
            }

            @Override
            public void onNext(HttpResponse<OutWrapBean> o) {
                responseCallback.success(o.getData(), getMyAttentionList_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getMyAttentionList(subscriber, page, pageSize, follow);
    }

    public void follow(int id, int status) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, follow_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), follow_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().follow(subscriber, id, status);
    }

    public void getMyLotteryFragmentData() {
        CommonSubscriber<HttpResponse<UserDataBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<UserDataBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getMyLotteryFragmentData_FAIL);
            }

            @Override
            public void onNext(HttpResponse<UserDataBean> o) {
                responseCallback.success(o.getData(), getMyLotteryFragmentData_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getMyLotteryFragmentData(subscriber);
    }

    public void getFootBallMathDataCheck(String num, int multiple, String free_pass) {
        CommonSubscriber<HttpResponse<ZqMatchDataCheck>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ZqMatchDataCheck>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getFootBallMathDataCheck_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ZqMatchDataCheck> o) {
                responseCallback.success(o.getData(), getFootBallMathDataCheck_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getFootBallMathDataCheck(subscriber, num, multiple, free_pass);
    }

    public void getBasketballMathDataCheck(String num, int multiple, String free_pass) {
        CommonSubscriber<HttpResponse<ZqMatchDataCheck>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ZqMatchDataCheck>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getBasketballMathDataCheck_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ZqMatchDataCheck> o) {
                responseCallback.success(o.getData(), getBasketballMathDataCheck_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getBasketballMathDataCheck(subscriber, num, multiple, free_pass);
    }

    public void getBasketballMatch() {
        CommonSubscriber<HttpResponse<Object>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<Object>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, getBasketballMatch_FAIL);
            }

            @Override
            public void onNext(HttpResponse<Object> o) {
                responseCallback.success(o.getData(), getBasketballMatch_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().getBasketballMatch(subscriber);
    }


    public void zfbH5Pay(String sn, String coupon_id, String payType, String return_url) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, zfbH5Pay_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), zfbH5Pay_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().zfbH5Pay(subscriber, sn, coupon_id, payType, return_url);
    }

    public void chongzhiByFs(@Nullable String sn, double amount, @NotNull String oauth, String pay_type, String return_url) {
        CommonSubscriber<HttpResponse<String>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<String>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, chongzhiByFs_FAIL);
            }

            @Override
            public void onNext(HttpResponse<String> o) {
                responseCallback.success(o.getData(), chongzhiByFs_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().chongzhiByFs(subscriber, sn, amount, oauth, pay_type, return_url);
    }

    public void optimize(String type, float totalMoney, String bonus) {
        CommonSubscriber<HttpResponse<ArrayList<ArrayList<String>>>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<ArrayList<ArrayList<String>>>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, optimize_FAIL);
            }

            @Override
            public void onNext(HttpResponse<ArrayList<ArrayList<String>>> o) {
                responseCallback.success(o.getData(), optimize_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().optimize(subscriber, type, totalMoney, bonus);
    }

    public void isRegister(String wxcode) {
        CommonSubscriber<HttpResponse<UserDataBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<UserDataBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, isRegister_FAIL);
            }

            @Override
            public void onNext(HttpResponse<UserDataBean> o) {
                responseCallback.success(o.getData(), isRegister_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().isRegister(subscriber, wxcode);
    }

    public void loginByPhone(String phone, String code) {
        CommonSubscriber<HttpResponse<UserDataBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<UserDataBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, loginByPhone_FAIL);
            }

            @Override
            public void onNext(HttpResponse<UserDataBean> o) {
                responseCallback.success(o.getData(), loginByPhone_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().loginByPhone(subscriber, phone, code);
    }


    public void registerByPhone(@NotNull String phone, @NotNull String code,String inviteCode) {
        CommonSubscriber<HttpResponse<UserDataBean>> subscriber = new CommonSubscriber<>(new SubscriberListener<HttpResponse<UserDataBean>>() {
            @Override
            public void onError(String e, int code) {
                responseCallback.fail(code, e, registerByPhone_FAIL);
            }

            @Override
            public void onNext(HttpResponse<UserDataBean> o) {
                responseCallback.success(o.getData(), registerByPhone_SUCCESS);
            }
        });
        RetrofitMethod.getInstance().registerByPhone(subscriber, phone, code,inviteCode);
    }
}
